#include <atomic>
#include <iostream>
#include <type_traits>

// 自定义类型 Point
struct Point {
    int x;
    int y;

    // 默认构造函数
    Point() : x(0), y(0) {}

    // 自定义构造函数
    Point(int x, int y) : x(x), y(y) {}

    // 拷贝构造函数和拷贝赋值操作符
    Point(const Point&) = default;
    Point& operator=(const Point&) = default;

    // 析构函数
    ~Point() = default;
};


int main() {
static_assert(std::is_trivially_copyable<Point>::value,
              "Point must be trivially copyable");

    std::atomic<Point> atomic_point;


    Point p1(1, 2);
    atomic_point.store(p1);

    Point p2 = atomic_point.load();
    std::cout << "Atomic Point: (" << p2.x << ", " << p2.y << ")" << std::endl;

    return 0;
}